package com.xzy.a;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 说明：
 * 1、通过XML文件中的Bean标签定义Bean
 * 2、通过XML文件创建Spring容器，依据XML文件中的Bean定义来创建Bean实例
 *
 * @author xzy
 * @date 2021/11/28 15:50
 */
public class Main {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
        UserService userServiceXml = applicationContext.getBean("userServiceXml", UserService.class);
        System.out.println(userServiceXml);
    }
}
